<div id="member_logo"></div>
<div class="content">
  <% if @valleyers %>
    <% @valleyers.each do |valleyer| %>
      <div class="monomer">
        <div id="picture">
          <%= link_to logo_image_tag(valleyer, :width => 95, :height => 95),
            valleyer_url(valleyer),
            :target => :_blank
        %>
        </div>
        <div class="message">
          <div class="name">
            <p>姓名：</p>
            <%= link_to valleyer.nick_name,
              valleyer_url(valleyer),
              :target => :_blank
          %>
            <p class="star"><%= image_tag('valleyer/star.jpg') %></p>
          </div>
          <p>资料：</p><b><%= valleyer.seat %></b>
        </div>
        <% if loggined_by_valleyer? %>
          <div class="operate">
            <%
            wait_requisition = WaitMakeFriendRequisition.has_been_for_friend(current_valleyer_id, valleyer.id)
            agree_requisition = AgreeMakeFriendRequisition.has_been_for_friend(current_valleyer_id, valleyer.id)
            reject_requisition = RejectMakeFriendRequisition.has_been_for_friend(current_valleyer_id, valleyer.id)
          %>
            <% if wait_requisition %>
              <div class="letter" title="于<%= time_ago_in_words wait_requisition.created_at, false %>之前申请">
                正在申请，等待对方同意
              </div>
            <% else %>
              <% if agree_requisition %>
                <div class="letter" title="于<%= time_ago_in_words agree_requisition.updated_at, false %>之前通过">
                  对方已同意你的交友申请
                </div>
              <% else %>
                <% if reject_requisition %>
                  <div class="letter" title="于<%= time_ago_in_words reject_requisition.updated_at, false %>之前拒绝">
                    对方已拒绝你的交友申请
                  </div>
                <% else %>
                  <%= link_to_remote "加为好友",
                    :update => :right,
                    :url => members_url(
                    :valleyer_id => valleyer.id),
                    :method => :get,
                    :html => {
                    :class => :addFriend
                  }
                %>
                <% end %>
              <% end %>
            <% end %>
      <%#*<div class="letter"><a href="javascript:;">发站内信</a></div>%>
          </div>
        <% end %>
      </div>
    <% end %>
  <% end %>
</div>